Hi, my self Ravi Vishwakarma. I have completed my studies at SPICBB Varanasi. now I completed MCA with 76% form Veer Bahadur Singh Purvanchal University Jaunpur.
SWE @ MindStick | Software Engineer | Web Developer | .Net Developer | Web Developer | Backend Engineer | .NET Core Developer
Aryan Kumar
06-Jun-2023Structs and classes are both user-defined data types in C#. However, there are some key differences between the two.
aandb, and you assign the value ofatob,bwill contain the same value asa, not a reference toa.In general, structs should be used for data types that are small and simple, such as Point or Color. Classes should be used for data types that are complex or that need to be inherited from, such as Person or Customer.
Here is a table that summarizes the key differences between structs and classes in C#:
Ravi Vishwakarma
29-Nov-2021Struct
Class